package com.ruoyi.market.service;

import cn.hutool.http.HttpUtil;

import java.lang.reflect.Array;
import java.net.HttpCookie;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public class Test {


    public static void main(String[] args) {

        String session = "JSESSIONID";
        String sessionValue = "64580b31-151e-4b00-8e16-5d3b1ffdb13a";

        String grUserId = "gr_user_id";
        String grUserIdValue = "f166793e-1ce1-4a0e-b94b-9cf536d93d14";


        HttpCookie sessionHttpCookie = new HttpCookie(session, sessionValue);
        HttpCookie grUserIdHttpCookie = new HttpCookie(grUserId, grUserIdValue);

        Map<String, Object> bizMap = new HashMap<>();
        bizMap.put("limit", "1000");
        bizMap.put("offset", "0");

        String requestUrl = "http://dsadmin.hq-iot.online/person/info/list";


        String body = HttpUtil.createGet(requestUrl)
                .cookie(Arrays.asList(sessionHttpCookie, grUserIdHttpCookie))
                .form(bizMap)
                .execute().body();

        System.out.println(body);


        /**
         * {"creState":1,"createdTime":"2022-12-17 16:00:56",
         * "delFlag":"0","userId":510608,"mobile":"15069531803",
         * "carrier":"移动","phoneLocation":"山东省聊城市",
         * "rank":0,"score":0,"precommendedCode":"tVsxnq3v",
         * "channelCode":"txm1","softType":"temp_h5",
         * "clientVersion":"1.3.1","activeCount":0,"kycStep":"1"}
         */
    }
}
